package interfaz;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;


public class NivelMedio extends JFrame {
	
	private static final long serialVersionUID = 1L;
	private JPanel mainPanel;
	private JMenuBar barraMenu;
	private JButton atrasButton;
	private Container buttonsPanel;
	private JMenu empezarMenu;
	private JMenu comprobarMenu;
	private JMenu vistaMenu;
	private JMenu solucionMenu;
	private JMenu informacionMenu;
	private JMenu ayudaMenu;
	private JMenu guardarMenu;
	
	public static void main(String[] args) {
		new NivelBajo().setVisible(true);
	}
	public NivelMedio(){
		inicializaComponentes();
		pack();
		
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = getSize();
        setLocation(new Point((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.width) / 2));
	}
	
	
	
	public void inicializaComponentes(){
		GridBagConstraints gridBagConstraints;
		
		barraMenu = new JMenuBar();
		mainPanel = new JPanel();
		atrasButton = new JButton();
		buttonsPanel = new JPanel();
		empezarMenu = new JMenu();
		comprobarMenu = new JMenu();
		vistaMenu = new JMenu();
		solucionMenu = new JMenu();
		informacionMenu = new JMenu();
		ayudaMenu = new JMenu();
		guardarMenu = new JMenu();
		
		
		setTitle("Link-A-Pix");
		
   		mainPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
	    mainPanel.setMinimumSize(new Dimension(297, 200));
	    mainPanel.setLayout(new GridBagLayout());
	    
	    
	
	
	    atrasButton.setMnemonic('N');
	    atrasButton.setText("Volver");
	    atrasButton.setToolTipText("Volver");
	    atrasButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            atrasButtonActionPerformed(evt);
        }
    });
	    gridBagConstraints = new GridBagConstraints();
	    gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
	    gridBagConstraints.gridheight = GridBagConstraints.REMAINDER;
	    gridBagConstraints.anchor = GridBagConstraints.SOUTHEAST;
    	gridBagConstraints.weighty = 1.0;
    	mainPanel.add(atrasButton, gridBagConstraints);
	
	
    	gridBagConstraints = new GridBagConstraints();
    	gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
    	gridBagConstraints.gridheight = GridBagConstraints.REMAINDER;
    	gridBagConstraints.anchor = GridBagConstraints.SOUTHEAST;
    	gridBagConstraints.weighty = 1.0;
    	mainPanel.add(buttonsPanel, gridBagConstraints);

    	getContentPane().add(mainPanel, BorderLayout.CENTER);
		
		
		empezarMenu.setMnemonic('E');
		empezarMenu.setText("Empezar");
		barraMenu.add(empezarMenu);
		
		comprobarMenu.setMnemonic('C');
		comprobarMenu.setText("Comprobar");
		barraMenu.add(comprobarMenu);	
		
		solucionMenu.setMnemonic('S');
		solucionMenu.setText("Solucion");
		barraMenu.add(solucionMenu);
		
		informacionMenu.setMnemonic('I');
		informacionMenu.setText("Informacion");
		barraMenu.add(informacionMenu);	
		
		ayudaMenu.setMnemonic('A');
		ayudaMenu.setText("Ayuda");
		barraMenu.add(ayudaMenu);
		
		guardarMenu.setMnemonic('G');
		guardarMenu.setText("Guardar");
		barraMenu.add(guardarMenu);
		
		setJMenuBar(barraMenu);
	
	
	}
		protected void atrasButtonActionPerformed(ActionEvent evt) {
			this.setVisible(false);
			new Niveles().setVisible(true);
		}

        

}

